Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Custom Prometheus Exporterによる オブザーバビリティ拡張 / Ext...
Search
kohbis
May 10, 2025
Technology
330
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Custom Prometheus Exporterによる オブザーバビリティ拡張 / Extending observability with Custom Prometheus Exporter
大LT 2025 春 in Aizu
https://zli.connpass.com/event/351157/
kohbis
May 10, 2025
More Decks by kohbis
See All by kohbis
人にやさしく、AIにやさしく、書き手を選ばないIaCのガードレール再考 / Rethinking IaC Guardrails for Humans and AI Alike
kohbis
6
2.1k
AIに丸投げしないトイル削減 / Eliminating Toil Without Leaving It All to AI
kohbis
5
1.3k
『家族アルバム みてね』における インシデント対応との向き合い方 / Approach incident response in Family Album
kohbis
2
560
Kubernetes環境周りの責任範囲をいい機会なので考える / Taking the Opportunity to Clarify Kubernetes Responsibilities
kohbis
2
470
『家族アルバム みてね』におけるAmazon EKSコストとの向き合い方 / Optimizing Amazon EKS Costs: The FamilyAlbum Case
kohbis
4
1.9k
潜在的課題探索活動の近況報告 / Exploration of latent challenges
kohbis
2
210
いま、あらためて考えてみるアカウント管理 with IaC / Account management with IaC
kohbis
3
1.3k
〜『世界中の家族のこころのインフラ』を目指して”次の10年”へ〜 SREが導いたグローバルサービスの信頼性向上戦略とその舞台裏 / Towards the Next Decade: Enhancing Global Service Reliability
kohbis
4
7.9k
Grafana MCP serverでなんかし隊 / Try Grafana MCP server
kohbis
0
1.1k
Other Decks in Technology
See All in Technology
AgentCoreで実践するハーネスエンジニアリング
yakumo
1
280
Snapshot Testing in Practice: Predictable and Reliable SwiftUI Views
fespinoza
0
120
React Nativeでの OTA Updateって、 どう説明する?
ichiki1023
0
150
Deep Data Security 機能解説
oracle4engineer
PRO
2
710
SREでアラート疲れを 解決しよう!
kairim0
1
200
使いこなすために知っておきたい Azure SRE Agent アンチパターン
torumakabe
2
360
生成AIと進める探索的データ分析(2026.10.03 第122回Tokyo.R勉強会)
tatamiya
2
1.4k
FinTech 1-2 : Overview of FinTech
ks91
PRO
0
150
営業オントロジーの作り方と、エージェントからの辿り方 ── ナレッジワークの現場から
kworkdev
PRO
1
270
Claude起点の仕様駆動開発
tanakaseiya
0
390
事業活動を AI Ready にする攻めと守りのデータエンジニアリング / data-engineering-for-ai-ready-business
pei0804
3
280
OpenSharing について熱く語る〜AI アセットの共有について〜
kameitomohiro
0
230
Featured
See All Featured
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
2k
Skip the Path - Find Your Career Trail
mkilby
1
240
Designing for Performance
lara
611
70k
Typedesign – Prime Four
hannesfritz
42
3.2k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.4k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
510
Designing for humans not robots
tammielis
254
26k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
3k
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
570
Transcript
©MIXI Custom Prometheus Exporterによる オブザーバビリティ拡張 2025/05/10 大LT 2025 春 in
Aizu 株式会社MIXI みてね事業本部 みてねプラットフォーム部 SREグループ 杉本浩平
©MIXI 2 お話しすること • “オブザーバビリティ ” • Prometheus • Prometheus
Exporter • Custom Prometheus Exporterの実装
©MIXI 3 “オブザーバビリティ ” システムの出力を調査することによって内部の状態を測定する能力のこと ※1 4つの主要なデータタイプ( MELT) Metrics •
システムのパフォーマンスやリソース使用状況を定量的に示す数値データ Events • システム内で発生した特定の事象や状態変化を記録するデータ Logs • システムやアプリケーションの動作に関する詳細なテキスト記録 Traces • 分散システムにおけるリクエストの流れを追跡し、各サービス間のやり取りや処理時間を可視化するデー タ ※1 https://www.splunk.com/ja_jp/blog/devops/observability.html
©MIXI 4 Prometheus Prometheus collects and stores its metrics as
time series data. メトリクスを時系列データとして収集&保存する ※1 主なコンポーネント Prometheus Server • ターゲットからMetricsを収集して保存(他いろいろ) Service Discovery • ターゲットを自動的に検出 Exporter • システムやアプリケーションのMetricsをPrometheus Serverが収集できる形式で提供 Pushgateway • ライフサイクルが短いジョブからMetricsをプッシュ Alertmanager • Prometheus Serverから送信されるアラートを処理 ※1より引用 ※1 https://prometheus.io/docs/introduction/overview
©MIXI 5 Prometheus Exporter • いわゆる監視エージェントの役割 • 特定のシステムやアプリケーションをターゲットとし、メトリクスを収集し、 HTTPエンドポイントで公開 •
公式ドキュメントに記載されているだけでも200ほど • DBやクラウドサービスなど、あらゆるシステムやサービスに対応したPrometheus公式またはサードパーティ製 どのようなときに欲しくなる? 1. 利用しているソフトウェアがPrometheus形式のメトリクスを提供していない (例)MySQL server exporter, Redis exporter, 2. ホストマシンのシステムメトリクスを取得したい (例)Node/system metrics exporter, Windows exporter 3. ネットワーク機器や外部サービスを監視したい (例)SNMP exporter, Blackbox exporter 4. 独自アプリケーションやサービスを監視したい (例)クライアントライブラリで Expoterを自作 https://prometheus.io/docs/instrumenting/clientlibs/
©MIXI 6 Prometheusのメトリクス形式 1行目:# HELP メトリクスの説明文 2行目:# TYPE メトリクスの種類 3行目:メトリクス
この例では「HTTPメソッド x レスポンスコードごとのリクエスト数の変化を時系列的に追跡する」 ことが可能になる Prometheusのメトリクス形式でレスポンスを返却するエンドポイントを公開さえできれば ありとあらゆるシステムやアプリケーションの可視化や分析が可能になる
©MIXI 7 Custom Prometheus ExporterのRuby実装例(without client library) Prometheusのメトリクス形式の出力であればいい ので シンプルな実装でカスタムメトリクスを公開可能
1. メトリクスデータを Hash.new で初期化 2. ダミーデータを作成 • metrics += 1 で定期的に加算 3. webrickサーバーを起動 4. /metrics へのリクエストに、Prometheusのメトリクス形式のテ キストをレスポンス • # HELP を追加 • # TYPE を追加 • Hashのkey/valueを追加 ⬆ メトリクスの種類が増えただけ対応する必要がある
©MIXI 8 Custom Prometheus ExporterのRuby実装例(with client library) クライアントライブラリを使用すると簡単に作成可能 公式にはGo /
Java or Scala / Python / Ruby / Rustをサポート 1. Rubyのclientライブラリを使用 https://github.com/prometheus/client_ruby 2. レジストリを作成して、メトリクスを管理(in-memory) Counterメトリクスを定義 • GaugeやHistogramなどタイプがある https://prometheus.io/docs/concepts/metric_types 3. レジストリにCounterメトリクスを登録 4. ダミーデータを作成 • counter.increment で定期的に加算 5. webrickサーバーを起動 6. /metrics へのリクエストに、Prometheusのメトリクス形式のテ キストをレスポンス • クライアントライブラリが組み立ててくれる
©MIXI 9 業務で見ているもの(一部)
©MIXI “オブザーバビリティ ”に 思いを馳せてみるのもよいかも?
©MIXI